package com.speakglobe.panelist.model;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * Represent group of users. 
 */
@Entity
@Table(name="binary_spec")
public class BinarySpec implements Serializable {

	private static final long serialVersionUID = 6554904325012186877L;
	
	@Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
	
	@OneToOne
	@JoinColumn(name="panelist_id")
	private Panelist panelist;
	
	@OneToOne
	@JoinColumn(name="sponsor_id")
	private Panelist sponsor;
	
	@OneToOne
	@JoinColumn(name="upline_id")
	private Panelist upline;
	
	@OneToMany
	private Set<Panelist> downlines;
	private int position;
	private int level;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Panelist getPanelist() {
		return panelist;
	}

	public void setPanelist(Panelist panelist) {
		this.panelist = panelist;
	}

	public Panelist getSponsor() {
		return sponsor;
	}

	public void setSponsor(Panelist sponsor) {
		this.sponsor = sponsor;
	}

	public Panelist getUpline() {
		return upline;
	}

	public void setUpline(Panelist upline) {
		this.upline = upline;
	}

	public Set<Panelist> getDownlines() {
		return downlines;
	}

	public void setDownlines(Set<Panelist> downlines) {
		this.downlines = downlines;
	}

	public int getPosition() {
		return position;
	}

	public void setPosition(int position) {
		this.position = position;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}
	
	
}
